package com.by.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.by.model.dto.thumb.DoThumbDTO;
import com.by.model.entity.Thumb;
import jakarta.servlet.http.HttpServletRequest;

/**
 * @author lzh
 */
public interface ThumbService extends IService<Thumb> {

    /**
     * 点赞
     *
     * @param doThumbDTO 点赞请求
     * @param request    请求对象
     * @return 点赞结果
     */
    Boolean doThumb(DoThumbDTO doThumbDTO, HttpServletRequest request);

    /**
     * 取消点赞
     *
     * @param doThumbDTO 点赞请求
     * @param request    请求对象
     * @return 取消点赞结果
     */
    Boolean undoThumb(DoThumbDTO doThumbDTO, HttpServletRequest request);

    /**
     * 判断某个用户是否对某个博客有点赞
     *
     * @param blogId 博客ID
     * @param userId 用户ID
     * @return 是否点赞
     */
    Boolean hasThumb(Long blogId, Long userId);
}
